package io.renren.modules.project.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.project.dao.PginoinoDao;
import io.renren.modules.project.entity.PginoinoEntity;
import io.renren.modules.project.service.PginoinoService;


@Service("pginoinoService")
public class PginoinoServiceImpl extends ServiceImpl<PginoinoDao, PginoinoEntity> implements PginoinoService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String projectName = (String)params.get("key");
        IPage<PginoinoEntity> page = this.page(
                new Query<PginoinoEntity>().getPage(params),
                new QueryWrapper<PginoinoEntity>()
                        .like(StringUtils.isNotBlank(projectName),"project_name", projectName)
        );

        return new PageUtils(page);
    }

}